<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/functions" prefix= "fn"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选 择</title>
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/mainmenu2.css" rel="stylesheet"  type="text/css">
<link href="${ctx}/styles/show.css" rel="stylesheet" type="text/css">

<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/mainmenu2.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/listTable.js"></script>


<script language="JavaScript" type="text/javascript">
	var gListOver;
	//处理点击的td  1:改变点击的td样式 2:保存选择的房号ID、房号num到主页面
	function tdOnclickHandle(obj,houseId,houseNum){
		changeTdClick(obj);
		addToParent(houseId,houseNum);
	}
	/******设置选中的状态(样式和可用状态)为选中状态******/
	function changeTdClick(obj){
		obj.className = "2td_listTable_record_on";
		obj.disabled = true;
		//gListOver.className = "2td_listTable_record_off";
	}
	/********设置选中的状态(样式和可用状态)为未选中状态**********/
	function changeTd(tdId){
		var objTd = document.getElementById(tdId);
		objTd.className = "2td_listTable_record_off";
		objTd.disabled = false;
	}
	/******添加到父页面的表格*******/
	function addToParent(houseId,houseNumber){
		parent.multiHouseobj.addElement(houseId,houseNumber);
	}

	function init(){
		var selectHouseInfos = parent.multiHouseobj.getHouseInfo();
		for(var i = 0; i < selectHouseInfos.length; i++){//将已选中的 设为不可选状态
			if( document.getElementById(selectHouseInfos[i].houseId) != null)
				changeTdClick(document.getElementById(selectHouseInfos[i].houseId));
		}
	}
</script>
</head>

<body onload="init();">

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="outtable">
  <tr>
    <td  valign="top">
    	<div style="height:260px;overflow:auto;">
		      <table width="100%" border="0" cellspacing="0" cellpadding="0">
		        <tr>
		          <td>
				  	<table width="100%"  border="0" cellpadding="0" cellspacing="1" >
		                    <tr>
		                      <td align="left" valign="top" nowrap class="LeftdownBlock1" style="padding-top:3px;">

		                      	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="room_border">
									<c:choose>
										<c:when test="${empty members}">
											<tr>
												<td width="100%" class="listTable_normal_word"   onFocus="this.blur()">
													列表中没有任何记录
												</td>
											</tr>
										</c:when>
										<c:when test="${not empty members}">
											<c:forEach items="${members}" var="memberItems" >
												<tr>
													<td align="center" class="listTable_normal_word" width="6%">${memberItems[0]}F</td>
													<c:forEach items="${memberItems}" var="memberItem" begin="1">
					                        			<td width="${(100 div maxHouseCount) < 8 ?8:(100 div maxHouseCount)}%"
					                        				class="2td_listTable_record_off"
					                        				href="#"
					                        				name="${memberItem.keyword}"
					                        				onFocus="this.blur()"
					                        				ondblclick="tdOnclickHandle(this,'${memberItem.keyword}','${memberItem.houseNumber}');"
					                        				id="${memberItem.keyword}"
					                        				order="1">
					                        					${memberItem.houseNumber}
					                        			</td>
													</c:forEach>

													<c:if test="${fn:length(memberItems) < maxHouseCount}">
														<c:forEach begin="1" end="${maxHouseCount - fn:length(memberItems)}">
															<td width="${(100 div maxHouseCount) < 8 ?8:(100 div maxHouseCount)}%" class="2td_listTable_record_off"  href="#"  onFocus="this.blur()"   order="1"/>
														</c:forEach>
													</c:if>
												</tr>
											</c:forEach>
										</c:when>
									</c:choose>
		                  		</table>
		                  	  </td>
		                    </tr>
		            </table>
					</td>
		        </tr>
		      </table>
		   </div>
      </td>
    </tr>
</table>
</body>
</html>
